<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateVersionTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('version', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->comment('版本名称');
            $table->string('description')->comment('版本描述');
            $table->string('term1')->comment('期限1');
            $table->integer('price1')->comment('价格1');
            $table->string('term2')->comment('期限2');
            $table->integer('price2')->comment('价格2');
            $table->string('term3')->comment('期限3');
            $table->integer('price3')->comment('价格3');
            $table->string('term4')->comment('期限4');
            $table->integer('price4')->comment('价格4');
            $table->integer('discount1')->comment('优惠1');
            $table->integer('discount2')->comment('优惠2');
            $table->integer('discount3')->comment('优惠3');
            $table->integer('discount4')->comment('优惠4');
            $table->integer('createdAt')->comment('创建时间');
            $table->integer('updatedAt')->comment('最后更新时间');
        });
        DB::statement("ALTER TABLE `version` comment '版本信息表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('version');
    }
}
